
import axios from './axios'

export function sendData(params){
    return new Promise((resolve,reject)=>{
        if (params.method=='get'){
            axios.get(params.url,{params:params.params}).then(data=>{
                resolve(data)
            }).catch(e=>{
                reject(e)
            })
        }
        else if (params.method =='post'){
            axios.post(params.url,{params:params.params}).then(data=>{
                resolve(data)
            }).catch(e=>{
                reject(e)
            })
        }
        else {
            //put、delete
        }
    })
}